<template>
	<view class="dgsp-detail">
		<view class="dgsp-title">
			<view class="dgsp-title-padd">
				<view class="dgsp-title-left">
					<image :src="datahead.brand_logo" mode="widthFix" lazy-load></image>
				</view>
				<view class="dgsp-title-right">
					{{datahead.introduce}}
				</view>
			</view>
		</view>
		<view class="dgsp-goods">
			<goodsList :dataList="dataList" :index="current"></goodsList>
		</view>
	</view>
</template>

<script>
	import apiindex from '../../common/api/index';
	import goodsList from '../../components/goods/goods-list.vue'
	export default {
		data() {
			return {
				// 分类数据
				datahead:{
					brand_logo:'',
					introduce:'',
				},
				current:1,
				dataList:[],
				gl_params:{
					id:0
				}
			}
		},
		onLoad(option) {
			this.gl_params.id=option.id
		},
		created(){
			uni.showNavigationBarLoading()
			this.brand_detail()
		},
		components:{
			apiindex,
			goodsList,
		},
		
		methods: {
			brand_detail(){
				apiindex.brand_detail(this.gl_params).then(res =>{
					if(res.code == 1){
						this.dataList=res.data.items
						this.datahead.brand_logo=res.data.brand_logo
						this.datahead.introduce=res.data.introduce
						uni.hideNavigationBarLoading()
					}
				}).catch(res =>{
					
				});
			}
		}
	}
</script>

<style scoped>
	page{
		background-color: #F5F5F5;
	}
	.dgsp-detail{
		width:100%;
	}
	.dgsp-title{
		width:100%;
		background-color:#FFFFFF;
	}
	.dgsp-title-padd{
		width:94%;
		padding:3% 0;
		background-color: #FFFFFF;
		display:flex;
		justify-content: space-around;
		align-content: center;
	}
	.dgsp-title-left{
		width:18%;
		padding:1%;
	}
	.dgsp-title-left>image{
		width:100%;
		margin-top:30upx;
	}
	.dgsp-title-right{
		width:76%;
		padding:2%;
		text-align:center;
	}
	.dgsp-goods{
		width:98%;
		margin:1%;
		border-radius: 20upx;
		background-color:#FFFFFF;
	}
</style>
